
<!DOCTYPE html>
<html>
<head>
<title>IT工程师后台管理</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
<link href='css/core/bootstrap.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/core/light-theme.css' id='color-settings-body-color' media='all' rel='stylesheet' type='text/css' />
<link href='css/uploadify.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/base.css' media='all' rel='stylesheet' type='text/css' />
<link href='css/exam.css' media='all' rel='stylesheet' type='text/css' />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body class=''>
<header id="header">

</header>

<div id='wrapper'>
    <div id='main-nav-bg'></div>
    <nav class='' id='main-nav'>
        <div id="guide" class='navigation'>
            
        </div>
    </nav>
    <section id='content'>
        <div class='container-fluid'>
            <div class='row-fluid' id='content-wrapper'>
                <div class='span12'>
                    <div class='page-header'>
                        <h1 class='pull-left'>
                            <i class='icon-dashboard'></i>
                            <span>博创华宇教育管理</span>
                        </h1>
                    </div>
                    <div class='row-fluid'>
                        <div class='span12 box'>
                            <div class='box-header'>
                                <div class='title'>
                                    添加考题
                                </div>
                            </div>
                            <div class='box-content'>
                                <div class='row-fluid'>
                                    <div class='parentdomEvt span4 box box-nomargin'>
                                        <div class='box-header box-header-small green-background'>
                                            <div class='title'>
                                                <i class='icon-resize-vertical'></i>
                                                <font id="courseName">课程名称</font>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="span8 box box-bordered">
                                           <div class='row-fluid'>
                                            <div class='span12 box' style='margin-bottom: 0'>
                                                <div class='box-header purple-background'>
                                                    <div class='title'>试题详情</div>
                                                </div>
                                                <div class='box-content'>
                                                    <div class='detail row-fluid'>
                                                        <div class='span12'>
                                                            <div class='tabbable examContent detailEvt hide'>
                                                                <ul class='nav nav-tabs'>
                                                                    <li class='lievt active'>
                                                                        <a><i class='icon-ambulance text-blue'></i><font style='padding: 5px;'>考试</font></a>
                                                                    </li>
                                                                </ul>
                                                                <div class='tab-content'>
                                                                    <div id='issue' class='issue tab-pane active'>
                                                                        <div class='control-group'>
                                                                            <label class='control-label'>试题一</label>
                                                                            <div class='controls'>
                                                                                <input class='span12' type='text' />
                                                                            </div>
                                                                        </div>
                                                                        <div class='control-group'>
                                                                            <label class='control-label'>试题二</label>
                                                                            <div class='controls'>
                                                                                <input class='span12' type='text' />
                                                                            </div>
                                                                        </div>
                                                                        <div class='control-group'>
                                                                            <label class='control-label'>试题三</label>
                                                                            <div class='controls'>
                                                                                <input class='span12' type='text' />
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <!-- <div class='text-right'>
                                                                    <div id="examSave" class='btn btn-primary btn-large'>
                                                                        <i class='icon-save'></i>
                                                                        保存此知识点试题
                                                                    </div>
                                                                </div> -->
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class='form-actions' style='margin-bottom: 0;'>
                                    <div class='text-center'>
                                        <div class='control-group'>                   
                                            <div class='controls' >
                                                <button class="btn btn-success export" style="margin-bottom:5px;float:left;" >导出模版</button>
                                                <input id='examBtn' type='file' name='file' style='width:20%;'>
                                                <div id='examList'></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>   
        </div>            
    </section>
</div>
<script src='js/core/jquery.min.js' type='text/javascript'></script>
<script src='js/core/bootstrap-treeview.min.js' type='text/javascript'></script>
<script src='js/core/uploadify.js' type='text/javascript'></script>
<script src="js/core/line.js"></script>
<script src="js/core/drag.js"></script>
<script src='js/core.js' type='text/javascript'></script>
<script src='js/res.js' type='text/javascript'></script>
<script src='js/init.js' type='text/javascript'></script>
<script src='js/course.js' type='text/javascript'></script>
</body>
<script type="text/javascript">
    Course.examTreeInit();
    $(".export").click(Course.export);
    $("#examBtn").uploadify({
        'swf'        : 'js/core/uploadify.swf',
        'uploader'   :  Core.API_VER+"/uploadXLSX",
        'buttonText' : '导入全部试题',
        'method':"post",
        'fileTypeDesc': '请选择附件格式', 
        'fileTypeExts': '*.xlsx',
        'fileSizeLimit'   : '3072',
        'onUploadSuccess' : function(file, res) {
            res = eval('(' + res + ')');
            if (res.code) {
                $alert(res.codemsg);
                return;
            }                    
            var table = res.result;  
            SetLS("importExam",table);
            var head = '';
            var maxLength = getCount(table[0]);
            var index = 0;
            var tableHtml = '<table style="width:100%" class="table table-bordered courses"><thead><tr>';
            for (var i = 0; i < table.length; i ++){
                if (maxLength<=getCount(table[i])){  
                    maxLength = getCount(table[i]); 
                    index = i;
                    head = '';
                    for (var key in table[i]){ 
                        head +='<th>'+ key +'</th>';               
                    }
                }    
            }           
            tableHtml += head + '</tr></thead>';
            for (var i = 0; i < table.length; i ++){
                tableHtml += '<tbody><tr>';
                for (var key in table[index]){
                    tableHtml +='<td>'+ (table[i][key]?table[i][key]:"") +'</td>';               
                }
                tableHtml += '</tr></tbody>';
            }           
            tableHtml += '</table>';
            Course.showTable(tableHtml);
        },
        'onUploadStart' : function(file) {
                             
        } 
    });
</script>
</html>